package com.tsystems.school;

/**
 * Created by IntelliJ IDEA.
 * User: victorn
 * Date: 8/14/11
 * Time: 11:57 PM
 * To change this template use File | Settings | File Templates.
 */
public class Node {

    private Comparable value;
    private Node left;
    private Node right;
    private int height;

    public Node(Comparable val, Node left, Node right) {
        value = val;
        this.left = left;
        this.right = right;
        height = 0;
    }

    public boolean hasLeft(){
        return left != null;
    }

    public boolean hasRight(){
        return right != null;
    }

    public void setLeft(Node left){
        this.left = left;
    }

    public Node getLeft(){
        return left;
    }

    public Comparable getValue() {
        return value;
    }

    public void setValue(Comparable value) {
        this.value = value;
    }

    public Node getRight() {
        return right;
    }

    public void setRight(Node right) {
        this.right = right;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }
}
